import React from 'react';
import { LeftOutlined } from '@ant-design/icons';
import {useHistory} from 'react-router';
import style from './Header.module.scss';
interface Iprops{
    title:string,
    background?:string
}

const Header:React.FC<Iprops> = props=>{
    const history = useHistory();
    return <div className={style.header} style={{background:props.background?props.background:'#fff'}}>
        <div className={style.left}>
            <LeftOutlined onClick={()=>history.goBack()} />
        </div>
        <div className={style.title}>{props.title}</div>
        <div className={style.right}></div>
    </div>
}

export default Header